//
//  LBInterstitialViewController.m
//  LbAdDemo
//
//  Created by SX on 2021/9/22.
//


#import "LBInterstitialViewController.h"
#import <LbAdSdk/ADv.h>
#import "Config.h"

@interface LBInterstitialViewController () <InterstitialDelegate>
@property (nonatomic, strong) InterstitialAD* interstitialAD;
@end

@implementation LBInterstitialViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self showAD];
}

- (void)showAD{
    _interstitialAD = [ADv showInterstitialAD:LB_TEST_INTERSTITIAL_ID viewController:self delegate:self];
}

- (void)reloadAD{
    [_interstitialAD reload];
}

// MARK:-loading
- (void)didFailToLoadADWithPlacementID:(NSString *)placementID error:(NSError *)error {
    NSLog(@"LBInterstitialViewController::didFailToLoadADWithPlacementID:%@ error:%@",placementID,error);
}

- (void)didFinishLoadingADWithPlacementID:(NSString *)placementID {
    NSLog(@"LBInterstitialViewController::didFinishLoadingADWithPlacementID:%@",placementID);
}


// MARK:- delegate
-(void) interstitialDidShowForPlacementID:(NSString *)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidShowForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) interstitialFailedToShowForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialFailedToShowForPlacementID:%@ error:%@ extra:%@", placementID, error, extra);
}

-(void) interstitialDidFailToPlayVideoForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary*)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidFailToPlayVideoForPlacementID:%@ error:%@ extra:%@", placementID, error, extra);
}

-(void) interstitialDidStartPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidStartPlayingVideoForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) interstitialDidEndPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidEndPlayingVideoForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) interstitialDidCloseForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidCloseForPlacementID:%@ extra:%@", placementID, extra);
}

-(void) interstitialDidClickForPlacementID:(NSString*)placementID extra:(NSDictionary *)extra {
    NSLog(@"LBInterstitialViewController::interstitialDidClickForPlacementID:%@ extra:%@", placementID, extra);
}

@end
